package  
{
	import org.flixel.*;
	import ConfigData;
	import HeartTombstone;
	
	public class TombstoneHUD extends FlxGroup
	{
		private var _playState:PlayState = null;
		public var numberOfHeartTombstones:Number = 0.0;
		
		public function TombstoneHUD(playState:PlayState) 
		{
			_playState = playState;
		}
		
		public function createHUDHeart(shirtColorIndex:int=-1):HeartTombstone 
		{
			// If I'm just creating random tombstones, I don't care what color they are
			if (shirtColorIndex == -1)
				shirtColorIndex = int(Math.random() * ConfigData.AVAILABLE_SHIRT_COLORS.length);
			var newTombstone:HeartTombstone = new HeartTombstone(this, shirtColorIndex);
			var tombstoneSpaceAllotted:int = (FlxG.width / ConfigData.NUMBER_OF_GENERATIONS_TO_WIN);
			var tombstoneOffsetVariable:Number = (tombstoneSpaceAllotted - newTombstone.frameWidth) / 2.0;
			newTombstone.setX(numberOfHeartTombstones * tombstoneSpaceAllotted + tombstoneOffsetVariable);
			newTombstone.setY(ConfigData.LARGE_TOMBSTONE_Y);
			newTombstone.scrollFactor = new FlxPoint(0, 0);
			add(newTombstone);
			numberOfHeartTombstones++;
			return newTombstone;
		}
	}
}